<?

require_once('functions.php');

$extcmd=$_REQUEST['extcmd'];

?>

<HTML>
<HEAD><TITLE>Voiper Services Administrator</TITLE>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<link href="home.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<SCRIPT language="javascript" type="text/javascript">
<!--
function changelayer_color(newcolor,numerotab){
      if(document.layers){
 //thisbrowser="NN4";
document.layers[numerotab].bgColor=newcolor;
}
if(document.all){
            //thisbrowser="ie"
//  document.all.numerotab.style.backgroundColor=newcolor;
   document.getElementById(numerotab).style.backgroundColor=newcolor;
       }
 if(!document.all && document.getElementById){
     //thisbrowser="NN6";
   document.getElementById(numerotab).style.backgroundColor=newcolor;
 }
 }

function ddclient_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the DDClient Service?\\nBefore enabling this service you must be configured\\nthe DDclient with DynamicDNS Webconfig.")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function dhcpd_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the Dhcp Server?\\nBefore enabling this service you must be configured\\nthe Dhcp Server with Webmin.")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function logwatch_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the DDClient LogWatch?\\nBefore enabling this service you must be configured\\nthe LogWatch with LogWatch Webconfig.")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function snmpd_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the SNMP Service?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function tftp_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the TFTP Service?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function ntpd_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the NTP Service?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function vsftpd_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the VSFTPD Service?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function argusd_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the ARGUS Service?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function webmin_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the WEBMIN Service?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function vagent_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("The Voiper Agent sends a few statistical data of the\\nhardware platform used and the started services on the Voiper PBX.\\n\\nAre you sure to enable the Voiper Agent Service?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function bi4sftpd_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the bi4data Client?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function sshd_start(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to enable the SSH Service?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

function network_reload(f2) {

	cancel = false;
	ok = true;

	if (confirm("<?php echo _("Are you sure to Reload and Enable the Networks settings?")?>"))
  		return ! cancel;
	else
  		return ! ok;
}

// -->
</SCRIPT>
</HEAD>

<BODY text="#333333" vLink="#000000" aLink="#000000" link="#000000" bgColor="#ffffff" background="images/vgs.gif">

<DIV align=center>

  <TABLE cellSpacing=0 cellPadding=1 width=619 border=0>
  <TBODY>
  <TR bgColor=#000000>
    <TD width="100%">
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD width="100%" bgColor=white>
            <TABLE cellSpacing=2 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD bgColor=#FFFFFF><div align="left"><FONT face="Verdana, Arial, Helvetica, sans-serif" size=1><?php echo _("Welcome")?> <b><? echo getenv('REMOTE_USER'); ?></b> (<?php echo _("Administrator")?>)</font></div></TD>
             </TR>
              <TR>
                <TD bgColor=#FFFFFF><div align="center"><a href="services.php" onFocus="this.blur()" target="_self"><img src="images/logo_voiper.jpg" border="0"></a></div></TD>
             </TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD width="100%" height="1"></TD></TR>
        <TR>
          <TD width="100%" bgColor=#eeeeee>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top width="31%" bgColor="#5cb148">
                  <TABLE cellSpacing="0" cellPadding="3" width="100%" border="0">
                    <TBODY>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>&nbsp;</FONT></TD>
               </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=sshd_start" onFocus="this.blur()" target="_self" onClick="return sshd_start(this);" onMouseOver="changelayer_color('#CCCCCC','78');" onMouseOut="changelayer_color('#f4f2f2','78');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=sshd_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','78');" onMouseOut="changelayer_color('#f4f2f2','78');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("SSH Server")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=ddclient_start" onFocus="this.blur()" target="_self" onClick="return ddclient_start(this);" onMouseOver="changelayer_color('#CCCCCC','8');" onMouseOut="changelayer_color('#f4f2f2','8');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=ddclient_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','8');" onMouseOut="changelayer_color('#f4f2f2','8');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("DynamicDNS")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=dhcpd_start" onFocus="this.blur()" target="_self" onClick="return dhcpd_start(this);" onMouseOver="changelayer_color('#CCCCCC','21');" onMouseOut="changelayer_color('#f4f2f2','21');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=dhcpd_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','21');" onMouseOut="changelayer_color('#f4f2f2','21');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("DHCP Server")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=logwatch_start" onFocus="this.blur()" target="_self" onClick="return logwatch_start(this);" onMouseOver="changelayer_color('#CCCCCC','23');" onMouseOut="changelayer_color('#f4f2f2','23');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=logwatch_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','23');" onMouseOut="changelayer_color('#f4f2f2','23');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("Logwatch")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=snmpd_start" onFocus="this.blur()" target="_self" onClick="return snmpd_start(this);" onMouseOver="changelayer_color('#CCCCCC','24');" onMouseOut="changelayer_color('#f4f2f2','24');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=snmpd_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','24');" onMouseOut="changelayer_color('#f4f2f2','24');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("SNMP")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=tftp_start" onFocus="this.blur()" target="_self" onClick="return tftp_start(this);" onMouseOver="changelayer_color('#CCCCCC','26');" onMouseOut="changelayer_color('#f4f2f2','26');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=tftp_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','26');" onMouseOut="changelayer_color('#f4f2f2','26');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("TFTP Server")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=ntpd_start" onFocus="this.blur()" target="_self" onClick="return ntpd_start(this);" onMouseOver="changelayer_color('#CCCCCC','27');" onMouseOut="changelayer_color('#f4f2f2','27');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=ntpd_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','27');" onMouseOut="changelayer_color('#f4f2f2','27');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("NTP")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=vsftpd_start" onFocus="this.blur()" target="_self" onClick="return vsftpd_start(this);" onMouseOver="changelayer_color('#CCCCCC','28');" onMouseOut="changelayer_color('#f4f2f2','28');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=vsftpd_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','28');" onMouseOut="changelayer_color('#f4f2f2','28');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("VSFTPD")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=argusd_start" onFocus="this.blur()" target="_self" onClick="return argusd_start(this);" onMouseOver="changelayer_color('#CCCCCC','29');" onMouseOut="changelayer_color('#f4f2f2','29');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=argusd_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','29');" onMouseOut="changelayer_color('#f4f2f2','29');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("ARGUSD")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=webmin_start" onFocus="this.blur()" target="_self" onClick="return webmin_start(this);" onMouseOver="changelayer_color('#CCCCCC','30');" onMouseOut="changelayer_color('#f4f2f2','30');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=webmin_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','30');" onMouseOut="changelayer_color('#f4f2f2','30');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("WEBMIN")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=vagent_start" onFocus="this.blur()" target="_self" onClick="return vagent_start(this);" onMouseOver="changelayer_color('#CCCCCC','32');" onMouseOut="changelayer_color('#f4f2f2','32');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=vagent_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','32');" onMouseOut="changelayer_color('#f4f2f2','32');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("VAGENT")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=bi4sftpd_start" onFocus="this.blur()" target="_self" onClick="return bi4sftpd_start(this);" onMouseOver="changelayer_color('#CCCCCC','33');" onMouseOut="changelayer_color('#f4f2f2','33');"><?php echo _("Start")?></a> / <a href="services.php?extcmd=bi4sftpd_stop" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','33');" onMouseOut="changelayer_color('#f4f2f2','33');"><?php echo _("Stop")?></a><FONT color=#000000> <?php echo _("BI4DATA")?></FONT></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a href="services.php?extcmd=network_reload" onFocus="this.blur()" target="_self" onClick="return network_reload(this);" onMouseOver="changelayer_color('#CCCCCC','31');" onMouseOut="changelayer_color('#f4f2f2','31');"><?php echo _("Reload")?></a><FONT color=#000000> <?php echo _("NETWORK")?></FONT></FONT></TD>
                    </TR>
                     <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a onFocus="this.blur()" onclick="window.open('ddweb/ddweb.php','ddClientwebEditor','height=320,width=600,scrollbars=no,toolbar=no,location=no,screenX=100,screenY=20,top=50,left=200')" href="#" onMouseOver="changelayer_color('#CCCCCC','17');" onMouseOut="changelayer_color('#f4f2f2','17');"><?php echo _("DynamicDNS Webconfig")?></a></FONT></TD>
                    </TR>
                     <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a onFocus="this.blur()" onclick="window.open('logwatch/logwatch.php','LogwatchwebEditor','height=340,width=600,scrollbars=no,toolbar=no,location=no,screenX=100,screenY=20,top=50,left=200')" href="#" onMouseOver="changelayer_color('#CCCCCC','18');" onMouseOut="changelayer_color('#f4f2f2','18');"><?php echo _("LogWatch Webconfig")?></a></FONT></TD>
                    </TR>
                     <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#1E5118>+</FONT></B> <a onFocus="this.blur()" onclick="window.open('snmpdconfig/snmpdconfig.php','SnmpdwebEditor','height=250,width=410,scrollbars=no,toolbar=no,location=no,screenX=100,screenY=20,top=50,left=200')" href="#" onMouseOver="changelayer_color('#CCCCCC','19');" onMouseOut="changelayer_color('#f4f2f2','19');"><?php echo _("Snmpd Webconfig")?></a></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>&nbsp;</FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><B><FONT
                        color=#333333>+</FONT></B> <a href="index.php" onFocus="this.blur()" target="_self" onMouseOver="changelayer_color('#CCCCCC','13');" onMouseOut="changelayer_color('#f4f2f2','13');"><?php echo _("Main Menu")?></a></FONT></TD>
                    </TR>
                    <TR>
                      <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>&nbsp;</FONT></TD>
                    </TR>
                      </TBODY></TABLE></TD>
                <TD vAlign=top width="1%" background="images/frame1.gif"></TD>
                <TD vAlign=top width="67%" bgColor=#f4f2f2><table width="100%" border="0" cellspacing="0" cellpadding="3">
                  <tr>
                    <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>&nbsp;</FONT></TD>
                    </tr>
                  <tr>
                    <td><div id="78"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable SSH services.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="8"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable DynamicDNS services.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="21"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable DHCP server.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="23"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable Logwatch services.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="24"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable SNMP server.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="26"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable TFTP server.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="27"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable NTP Time server.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="28"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable VSFTPD FTP server.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="29"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable ARGUSD server.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="30"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable WEBMIN server.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="32"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable Voiper Agent.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="33"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Enable / Disable BI4DATA client.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="31"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Reload and Enable Networks settings.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="17"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Webconfig for the DynamicDNS service.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="18"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Webconfig for the LogWatch service.")?></font></div></td>
                    </tr>
                  <tr>
                    <td><div id="19"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Webconfig for the Snmpd service.")?></font></div></td>
                    </tr>                    
                  <tr>
                    <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>&nbsp;</FONT></TD>
                   </tr>
                  <tr>
                    <td><div id="13"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<?php echo _("Back to Administrator Menu.")?></font></div></td>
                    </tr>
                  <tr>
                    <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>&nbsp;</FONT></TD>
                   </tr>
                </table></TD>
              </TR></TBODY></TABLE>
            <TABLE cellSpacing=0 width="100%" bgColor="#e97948" background="images/frame4.gif" border=0>
              <TBODY>
              <TR>
                <TD><div align="left"><FONT face="Verdana, Arial, Helvetica, sans-serif" color=#000000 size=2>Pbx Hostname: <? echo passthru('hostname'); ?></FONT></div></TD>
                <TD><div align="right"><FONT face="Verdana, Arial, Helvetica, sans-serif" color=#000000 size=2><? echo "online: ".uptime(); ?>&nbsp;</FONT></div></TD>
              </TR></TBODY></TABLE>
            <TABLE cellSpacing=0 width="100%" bgColor=#FFFFFF background="images/frame4.gif" border=0>
              <TBODY></TBODY></TABLE>
          </TR></TBODY></TABLE></TR></TBODY></TABLE>

<?

switch($extcmd) {

	default:
	break;

	case 'sshd_start';
	exec ('/usr/bin/sudo /sbin/service sshd start');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 sshd on');
	break;

	case 'sshd_stop';
	exec ('/usr/bin/sudo /sbin/service sshd stop');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 sshd off');
	break;

	case 'ddclient_start';
	exec ('/usr/bin/sudo /sbin/service ddclient start');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 ddclient on');
	break;

	case 'ddclient_stop';
	exec ('/usr/bin/sudo /sbin/service ddclient stop');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 ddclient off');
    break;

	case 'dhcpd_start';
	exec ('/usr/bin/sudo /sbin/service dhcpd start');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 dhcpd on');
	break;

	case 'dhcpd_stop';
	exec ('/usr/bin/sudo /sbin/service dhcpd stop');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 dhcpd off');
	break;

	case 'logwatch_stop';
	exec ('sudo /bin/unlink /etc/cron.daily/00-logwatch');
	break;

	case 'logwatch_start';
	exec ('sudo /bin/ln -s /etc/log.d/scripts/logwatch.pl /etc/cron.daily/00-logwatch');
	break;

	case 'snmpd_start';
	exec ('/usr/bin/sudo /sbin/service snmpd start');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 snmpd on');
	break;

	case 'snmpd_stop';
	exec ('/usr/bin/sudo /sbin/service snmpd stop');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 snmpd off');
	break;

	case 'tftp_start';
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 tftp on');
	break;

	case 'tftp_stop';
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 tftp off');
	break;

	case 'ntpd_start';
	exec ('/usr/bin/sudo /sbin/service ntpd start');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 ntpd on');
	break;

	case 'ntpd_stop';
	exec ('/usr/bin/sudo /sbin/service ntpd stop');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 ntpd off');
	break;

	case 'vsftpd_start';
	exec ('/usr/bin/sudo /sbin/service vsftpd start');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 vsftpd on');
	break;

	case 'vsftpd_stop';
	exec ('/usr/bin/sudo /sbin/service vsftpd stop');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 vsftpd off');
	break;

	case 'argusd_start';
	exec ('/usr/bin/sudo /sbin/service argusd start');
	sleep(5);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 argusd on');
	break;

	case 'argusd_stop';
	exec ('/usr/bin/sudo /sbin/service argusd stop');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 argusd off');
	break;

	case 'webmin_start';
	exec ('/usr/bin/sudo /sbin/service webmin start');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 webmin on');
	break;

	case 'webmin_stop';
	exec ('/usr/bin/sudo /sbin/service webmin stop');
	sleep(2);
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 webmin off');
	break;

	case 'vagent_stop';
	exec ('sudo /bin/unlink /etc/cron.weekly/vagent');
	break;

	case 'vagent_start';
	exec ('sudo /bin/ln -s /usr/local/sbin/vagent_service /etc/cron.weekly/vagent');
	break;

	case 'bi4sftpd_start';
	exec ('/usr/bin/sudo /sbin/service bi4sftpd restart');
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 bi4sftpd on');
	break;

	case 'bi4sftpd_stop';
	exec ('/usr/bin/sudo /sbin/service bi4sftpd stop');
	exec ('/usr/bin/sudo /sbin/chkconfig --level 2345 bi4sftpd off');
	break;
}

require_once('status.php'); 

?>

</DIV>
</BODY></HTML>
